<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script>
        //1.利用函数求任意两个数的和
        function getSum(num1,num2){
            num = num1 + num2;
            console.log(num);                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             
        }
        getSum(50,60);
        //2.利用函数求任意两个数之间的和
        
        function getSun(sun1,sun2){
            var sum = 0;
            for(var i = sun1; i <= sun2;i++){
                sum = sum + i;
            }
            console.log(sum);
        }
        getSun(1,100);
        //3.注意点
        //(1)多个参数之间用逗号隔开
        //(2)形参可以看做是不用声明的变量
    </script>
</head>
<body>
    
</body>
</html>